package com.airlines.crewassignment.controller;

import org.joda.time.DateTime;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.airlines.base.config.response.ResponseResult;
import com.airlines.base.config.response.ResponseResultBuilder;
import com.airlines.crewassignment.service.optaplanner.OptaplannerService;

/**
 * @author xxxx
 * @date 2018年3月28日 
 * @description
 */
@RestController
public class OptaplannerController {
	public OptaplannerController() {
		System.out.print("init...");
	}
//	@Autowired
//	private OptaplannerService optaplannerService;
//	 
//	/**
//	 * 172.16.12.159:8080/optaplanner?date=2018-04-10
//	 * @return
//	 */
//	@RequestMapping("optaplanner")
//	public ResponseResult<String> optaplanner(String date){
//		DateTimeFormatter format = DateTimeFormat.forPattern("yyyy-MM-dd");
//         //时间解析
//        DateTime dateTime = DateTime.parse(date, format);
//		optaplannerService.test(dateTime,dateTime);
//		return ResponseResultBuilder.successResult(null, "排班结束");
//	}
//	
//	@RequestMapping("optaplannerTest")
//	public String optaplannerTest(String date){
//		 DateTimeFormatter format = DateTimeFormat.forPattern("yyyy-MM-dd");
//         //时间解析
//        DateTime start = DateTime.parse(date, format);
//        DateTime end = start.millisOfDay().withMaximumValue();
//		return optaplannerService.test(start,end);
//	}
}
